package com.wlyuan.open.assembler;

import com.wlyuan.basic.dto.carrier.CarrierUpdateDTO;
import com.wlyuan.basic.dto.carrier.OfflineCarrierCreationDTO;
import com.wlyuan.open.basic.dto.OpenCarrierCreationDTO;
import com.wlyuan.open.basic.dto.OpenCarrierUpdateDTO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author
 * 承运商转化
 */
public class CarrierAssembler {
    @Mapper(uses = {

    })
    public interface Assembler {

        OfflineCarrierCreationDTO assemble(OpenCarrierCreationDTO openCarrier);

        CarrierUpdateDTO assemble(OpenCarrierUpdateDTO openCarrier);
    }

    private static final Assembler ASSEMBLER = Mappers.getMapper(Assembler.class);

    public static OfflineCarrierCreationDTO assemble(OpenCarrierCreationDTO openCarrier){
        return ASSEMBLER.assemble(openCarrier);
    }

    public static CarrierUpdateDTO assemble(OpenCarrierUpdateDTO openCarrier){
        return ASSEMBLER.assemble(openCarrier);
    }

}
